﻿using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;

namespace ru.yourpictures.Core.Imaging.Filters.PhotoFilters
{
    /// <summary>
    /// Applies ellipse mask to the image. All pixels outside of the ellipse mask will be transparent.
    /// </summary>
    [FilterImplementation(GdiPlusImplemented = false, LowLevelImplemented = false)]
    public class Ellipse : FilterBase
    {
        private int _ellipseWidth = 0;
        private int _ellipseHeight = 0;
        private Point _ellipseCenter = new Point(0, 0);

        #region Public properties
        /// <summary>
        /// Point on the bitmap, where ellipse center will be located
        /// </summary>
        public Point EllipseCenter
        {
            get { return _ellipseCenter; }
            set { _ellipseCenter = value; }
        }

        public int EllipseHeight
        {
            get { return _ellipseHeight; }
            set { _ellipseHeight = value; }
        }

        public int EllipseWidth
        {
            get { return _ellipseWidth; }
            set { _ellipseWidth = value; }
        }
        #endregion

        #region Ctor
        public Ellipse(int ellipseWidth, int ellipseHeight, Point ellipseCenter)
        {
            _ellipseWidth = ellipseWidth;
            _ellipseHeight = ellipseHeight;
            _ellipseCenter = ellipseCenter;
        }
        public Ellipse() { }
        #endregion

        #region Public Filter Methods
        public override void Apply(Bitmap b)
        {
            b = Convert(b);
            _b = b;
        }

        public override Bitmap Convert(Bitmap b)
        {
            throw new NotImplementedException("GDI+ mode is not implemented");
        }
        #endregion

        protected override void FilterImplementation()
        {
            throw new NotImplementedException("Low level mode is not implemented");
        }
    }
}
